package com.qdlc.p2p.quartz;

import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

@Component
@Lazy(value = false)
public class QuartzJob {
   /* @Resource
    private BorrowRepaymentService borrowRepaymentService;

    @Resource
    private BondService bondService;

    @Resource
    private InviteService inviteService;

    @Resource
    private UpRateService upRateService;

    @Resource
    private ExperienceService experienceService;

    @Resource
    private UserRedEnvelopeService userRedEnvelopeService;

    @Resource
    private TppAccountService tppBalanceService;

    @Resource
    private UserService userService;

    @Resource
    private TppBonusDetailsService tppBonusDetailsService;

    @Resource
    private BorrowTenderService borrowTenderService;

    @Resource
    private TppInvestService tppInvestService;

    *//**
     * 还款提醒
     *//*
    @Scheduled(cron = "0 0 9 * * ?")//每天凌晨9点整
    public void doRepaymentNotice() {
        borrowRepaymentService.doRepaymentNotice();
    }

    *//**
     * 新浪对账
     *//*
    @Scheduled(cron = "0 0 8 * * ?")//每天凌晨8点整
    public void setDifference() {
        tppBalanceService.setDifference();
    }

    *//**
     * 查询新浪存钱罐收益（更新新浪存钱罐收益到平台用），再更新新浪存钱罐收益到平台
     *//*
    @Scheduled(cron = "0 0 4 * * ?")//每天凌晨4点整
    public void queryBonusDetails() {
        tppBonusDetailsService.queryBonusDetails();
    }

    *//**
     * 更新存钱罐基金收益率
     *//*
    @Scheduled(cron = "0 30 0 * * ?")//每天凌晨0点30分
    public void setQueryFundYield() {
        tppBalanceService.setQueryFundYield();
    }

    *//**
     * 逾期天数+利息
     *//*
    @Scheduled(cron = "0 30 0 * * ?")//每天凌晨0点30分
    public void doLate() {
        borrowRepaymentService.doLate();
    }

    *//**
     * 还款前一天停止债权转让(自动停止)
     * 修改债权状态为3
     *//*
    //@Scheduled(cron = "0 0 1 * * ?")//每天凌晨1点整
    public void setBondStopStatus() {
        bondService.autoStopBond();
    }

    *//**
     * 好友邀请奖励： 每天统计出前一天被邀请人投资总额列表
     *//*
    @Scheduled(cron = "0 0 9 * * ?")//每天凌晨0点20分
    public void doInviteUserTenderList() {
        inviteService.doInviteAward();
    }

    *//**
     * 红包、体验券、加息券过期处理
     *//*
    @Scheduled(cron = "0 0 2 * * ?")//每天凌晨2点
    public void expireDispose() {
        // 红包过期处理
        userRedEnvelopeService.redEnvelopeExpireDispose();

        // 体验券过期处理
        experienceService.experienceExpiredDispose();

        // 加息券过期处理
        upRateService.rateInterestExpiredDispose();
    }

    //@Scheduled(cron = "0 * *//*1 * * ?")  //每小时
    *//*public void flowRepay(){
        finanFlowService.quartzflowRepayPlan();
    }*//*

    *//**
     * 体验金还款
     *//*
//	@Scheduled(cron = "0 0 0 * * ?")//每天凌晨0点整	
    @Scheduled(cron = "0 0 1 * * ?")//每天凌晨1点整
    public void repaymentExperience() {
        List<BorrowTenderModel> list = borrowTenderService.repaymentExperience();
        for (BorrowTenderModel tenderModel : list) {
            User user = userService.find(tenderModel.getUserId());
            if (StringUtil.isNotBlank(user.getTppUserCustId())) {
                //体验金获取利息
                borrowTenderService.repaymentStatus(tenderModel, user);

            } else {
                throw new UserException("您还没有通过实名认证，请先通过实名认证！", BusinessException.TYPE_CLOSE);
            }

        }

    }

    *//**
     * 投标代收后异常业务重新处理
     *//*
    @Scheduled(cron = "0 0 3 * * ?")//每天凌晨3点整
    public void quartzAddTppTender() {
        tppInvestService.quartzAddTppTender();
    }*/

}
